package lotteryProgram;

import java.util.HashSet;
import java.util.Random;
import java.util.Set;

public class RandomNumberGeneratorTest {
    public static Set<Integer> generateRandomNumbers(int n, int max) {


        Set<Integer> set = new HashSet<>();
        Random random = new Random();

        while (set.size() < n) {
            int num = random.nextInt(max) + 1;
            set.add(num);
        }

        return set;
    }

    public static void main(String[] args) {
        Set<Integer> set = generateRandomNumbers(5, 100);
        System.out.println(set);
    }
}

